package com.gec.system.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gec.model.entity.SysParking;
import com.gec.model.vo.SysParkingQueryVo;
import com.gec.system.mapper.SysParkingMapper;
import com.gec.system.service.SysParkingService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 车位信息表 服务实现类
 * </p>
 *
 * @author Liangxj
 * @since 2023-12-06
 */
@Service
public class SysParkingServiceImpl extends ServiceImpl<SysParkingMapper, SysParking> implements SysParkingService {



    @Override
    public IPage<SysParking> selectPage(IPage<SysParking> page1, SysParkingQueryVo vo) {
        return this.getBaseMapper().selectPage(page1, vo);
    }

    @Override
    public void updateParkingStatus(Long id, Integer status) {
        //1.查询出当前用户
        SysParking sysParking = this.baseMapper.selectById(id);
        //2.设置状态
        sysParking.setStatus(status);
        //3.更新
        this.baseMapper.updateById(sysParking);
    }
}
